package com.yohann.designPattern.mediator;

/**
 * <p>
 * 中介
 * </p>
 *
 * @author Yohann
 * @since 2021/2/13 15:38
 */
public class Mediator {
    public static void main(String[] args) {
        User pony = new User("Pony");
        User jack = new User("Jack");

        /*
         * Sat Feb 13 15:39:42 CST 2021 [Pony] : Hi! Jack!
         * Sat Feb 13 15:39:42 CST 2021 [Jack] : Hello! Pony!
         */
        pony.sendMessage("Hi! Jack!");
        jack.sendMessage("Hello! Pony!");
    }
}